import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
const store = new Vuex.Store({
    state:{
        liuXiaoLe:-100,
        geBinJie:5,
        renYiHao:2,
        shenXiaoXu:-1
    },
    mutations:{
        SET_LIU_XIAO_LE(state,a,b,c,d){
            state.liuXiaoLe+=a;
        },
        SET_GE_BIN_JIE(state){
            state.geBinJie+=2;
        },
        SET_REN_YI_HAO(state,num){
            state.renYiHao+=num
        },
        SET_SHEN_XIAO_XU(state,num){
            state.shenXiaoXu+=num;
        }
    },
    getters:{
        sum(state){
            return state.liuXiaoLe+state.shenXiaoXu+state.renYiHao+state.geBinJie
        }
    }
})
export default store;